# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1TagField do
  @moduledoc """
  Contains the value and additional information on a field within a Tag.

  ## Attributes

  *   `boolValue` (*type:* `boolean()`, *default:* `nil`) - The value of a tag field with a boolean type.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Output only. The display name of this field.
  *   `doubleValue` (*type:* `float()`, *default:* `nil`) - The value of a tag field with a double type.
  *   `enumValue` (*type:* `GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1TagFieldEnumValue.t`, *default:* `nil`) - The value of a tag field with an enum type. This value must be one of the allowed values listed in this enum.
  *   `order` (*type:* `integer()`, *default:* `nil`) - Output only. The order of this field with respect to other fields in this tag. Can be set by Tag. For example, a higher value can indicate a more important field. The value can be negative. Multiple fields can have the same order, and field orders within a tag don't have to be sequential.
  *   `richtextValue` (*type:* `String.t`, *default:* `nil`) - The value of a tag field with a rich text type. The maximum length is 10 MiB as this value holds HTML descriptions including encoded images. The maximum length of the text without images is 100 KiB.
  *   `stringValue` (*type:* `String.t`, *default:* `nil`) - The value of a tag field with a string type. The maximum length is 2000 UTF-8 characters.
  *   `timestampValue` (*type:* `DateTime.t`, *default:* `nil`) - The value of a tag field with a timestamp type.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :boolValue => boolean() | nil,
          :displayName => String.t() | nil,
          :doubleValue => float() | nil,
          :enumValue =>
            GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1TagFieldEnumValue.t()
            | nil,
          :order => integer() | nil,
          :richtextValue => String.t() | nil,
          :stringValue => String.t() | nil,
          :timestampValue => DateTime.t() | nil
        }

  field(:boolValue)
  field(:displayName)
  field(:doubleValue)

  field(:enumValue,
    as: GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1TagFieldEnumValue
  )

  field(:order)
  field(:richtextValue)
  field(:stringValue)
  field(:timestampValue, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1TagField do
  def decode(value, options) do
    GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1TagField.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DataCatalog.V1beta1.Model.GoogleCloudDatacatalogV1TagField do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
